#include <hardware.h>
#include <lcd.h>
#include <lcd_control.h>

extern volatile unsigned char lcd_present;

// External Interrupt 1 service routine
// interrupt [INT1] void ext_int1_isr(void)
void clock(void)
{

if (lcd_present == 1)
    {     

    // display hh:mm:ss on top line of LCD without erasing bottom line, so don't use lcd_clear
    // ymdhms[3] is hours
    // ymdhms[4] is minutes
    // ymdhms[5] is seconds
    
    // on first call, write the entire line
    // each minute, re-write the entire line
    // this function will be called once per second
    // each second, change only what needs to be changed
    // every other second, replace ":" with " "    
    lcd_display_date();
    lcd_display_status("Clock");
    }
}
